; Macro file for Duet WiFi
; Generated by Modix - Version 3.4.5 Macro D

M300 P1333 S444															; beep
M291 S3 R"Park at the front" P"The printhead will park at the front and left"
if global.idex = 0
	if !move.axes[0].homed || !move.axes[1].homed						; If the printer hasn't been homed, home it
		G28 XY
elif global.idex = 1
	if !move.axes[0].homed || !move.axes[1].homed || !move.axes[3].homed; If the printer hasn't been homed, home it
		G28 XYU
		
M564 S1 H1																; Ensure axis limits are respected
G91																		; relative moves

if move.axes[2].homed													; Check if Z axis is homed
	if {(move.axes[2].machinePosition) < (move.axes[2].max - 5.5)} 		; if homed, check if there's sufficient space to raise head
		G1 Z+5 F3000 													; move Z up a bit

G90																		; absolute moves
G1 X50 Y50 F6000  														; move quickly to the front left
M300 S1111 P333															; beep

if global.idex = 1
	M291 S3 R"Secondary Printhead" P"Would you like the secondary printhead to also move to the front? Click OK to move, cancel if you want it to stay at the back"
	G1 U150